﻿@{
    Layout = null;
    string caseId = ViewBag.CaseId; 
    int countOper = ViewBag.Count;
    GetTimelineHeader  timelineHeader = ViewBag.timline;
    TimelineOperating[] timelineOperating = ViewBag.timelineOperating;

}

<div class="timelinebullet p-Absolute" />

@if (timelineHeader.timeline_type == "I")
{
    @Html.Raw("<span class=\"timeline-main-icon1\">")
}
else if (timelineHeader.timeline_type == "P")
{ 
    @Html.Raw("<span class=\"timeline-main-icon2\">")
}
else if (timelineHeader.timeline_type == "N")
{
    @Html.Raw("<span class=\"timeline-main-icon3\">")
}
else
{
    @Html.Raw("<span class=\"timeline-main-icon4\">")
}

<div class="timeline-main-icon p-Absolute"></div>
<div class="timeline-main-triangle p-Absolute"></div>
<div class="timeline-Title">
    <p>
        <a href="@Url.Action("ViewCase", "GroupList", new { id = timelineHeader.case_id })">
            @timelineHeader.type_text
        </a>
    </p>
    <time class="timeago">@*datetime="2015-04-16T12:52:17Z*@
        @timelineHeader.ShowDateTime
    </time>
    <!-- ใช้แบบ iso 8601 -->
</div>
@Html.Raw("</span>")
<div class="timeline-action p-Absolute" onclick="openActionBox('@timelineHeader.case_id');"></div>

<div class="timeline-action-box dNone p-Absolute">
    @Html.Partial("~/Views/GroupList/_CaseMenu.cshtml")
</div>

@* @Html.Partial("_GroupListTimeline")*@

<div class="timeline-Detail">
    <p><strong>@Multi.CaseCode</strong> @timelineHeader.case_code</p>
    <p><strong>@Multi.objective : </strong>@timelineHeader.objective_text</p>
    <p class="hideDetailBox"><strong>@Multi.summary : </strong>@timelineHeader.summary</p>
    <p class="dNone readMoreDetailBox"><a href="#" onclick="openDetailBox('@timelineHeader.case_id'); return false;">อ่านต่อ...</a></p>
    <p><strong>@Multi.defendent : </strong>@timelineHeader.defendant</p>
    <p><strong>@Multi.status_text : </strong>@timelineHeader.status_text</p>
</div>
<div class="timeline-Comment" id="Comment_show" onclick="openComment('@timelineHeader.case_id');">
    @timelineOperating.Count() การดำเนินการ 
    <div class="timeline-Comment-More"></div>
</div>

<!-- start loop -->

@foreach (var t in timelineOperating)
{
    <div class="timeline-Comment2 dNone Comment_tab_id">
        <div class="floatL timeline-Comment-Avatar">
            <img src="@t.image_base_64" alt="" />
        </div>
        <div class="timeline-Comment-Text">
            <p>@t.created_by_text</p>
            <p>
                @if (!string.IsNullOrEmpty(t.officer_id) && t.created_by_text == t.officer_id) {
                    @t.created_by_text   @t.officer_text @t.is_received;
                 } else if (string.IsNullOrEmpty(t.officer_id)) {
                    @t.created_by_text   @t.org_text  @t.is_received;
                 }
                @t.summary</p>
            <time class="timeago" datetime="">
                @t.ShowDateTime
            </time>
        </div>
        <div class="clear2"></div>
    </div>
}

<!-- end loop -->

<div class="timeline-Comment2 dNone Comment_show_more" onclick="openComment('@ViewBag.CaseId');">
    @Multi.previous
    <div class="timeline-Comment-More"></div>
</div> 